﻿using System;

using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace Silvermoon.Animations
{
    public class RectangleAnimation:Animation<Rectangle>
    {
        protected override Rectangle CalculateValue(float value)
        {
            int w = (int)((To.Width - From.Width) * value) + From.Width;
            int h = (int)((To.Height - From.Height) * value) + From.Height;
            int x = (int)((To.X - From.X) * value) + From.X;
            int y = (int)((To.Y - From.Y) * value) + From.Y;

            return new Rectangle(x, y, w, h);
        }
    }
}
